/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author The Lunatics
 */
@Entity
@Table(name = "nflteam")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Nflteam.findAll", query = "SELECT n FROM Nflteam n"),
    @NamedQuery(name = "Nflteam.findById", query = "SELECT n FROM Nflteam n WHERE n.id = :id"),
    @NamedQuery(name = "Nflteam.findByHometown", query = "SELECT n FROM Nflteam n WHERE n.hometown = :hometown"),
    @NamedQuery(name = "Nflteam.findByMascot", query = "SELECT n FROM Nflteam n WHERE n.mascot = :mascot"),
    @NamedQuery(name = "Nflteam.findByKeyCode", query = "SELECT n FROM Nflteam n WHERE n.keyCode = :keyCode"),
    @NamedQuery(name = "Nflteam.findByFullname", query = "SELECT n FROM Nflteam n WHERE n.fullname = :fullname"),
    @NamedQuery(name = "Nflteam.findByConference", query = "SELECT n FROM Nflteam n WHERE n.conference = :conference"),
    @NamedQuery(name = "Nflteam.findByDivision", query = "SELECT n FROM Nflteam n WHERE n.division = :division")})
public class Nflteam implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Size(max = 45)
    @Column(name = "hometown")
    private String hometown;
    @Size(max = 45)
    @Column(name = "mascot")
    private String mascot;
    @Size(max = 45)
    @Column(name = "keyCode")
    private String keyCode;
    @Size(max = 45)
    @Column(name = "fullname")
    private String fullname;
    @Size(max = 45)
    @Column(name = "conference")
    private String conference;
    @Size(max = 45)
    @Column(name = "division")
    private String division;
    @OneToMany(mappedBy = "teamId")
    private Collection<Nflplayergame> nflplayergameCollection;
    @OneToMany(mappedBy = "home")
    private Collection<Nflgame> nflgameCollection;
    @OneToMany(mappedBy = "away")
    private Collection<Nflgame> nflgameCollection1;

    public Nflteam() {
    }

    public Nflteam(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getHometown() {
        return hometown;
    }

    public void setHometown(String hometown) {
        this.hometown = hometown;
    }

    public String getMascot() {
        return mascot;
    }

    public void setMascot(String mascot) {
        this.mascot = mascot;
    }

    public String getKeyCode() {
        return keyCode;
    }

    public void setKeyCode(String keyCode) {
        this.keyCode = keyCode;
    }

    public String getFullname() {
        return fullname;
    }

    public void setFullname(String fullname) {
        this.fullname = fullname;
    }

    public String getConference() {
        return conference;
    }

    public void setConference(String conference) {
        this.conference = conference;
    }

    public String getDivision() {
        return division;
    }

    public void setDivision(String division) {
        this.division = division;
    }

    @XmlTransient
    public Collection<Nflplayergame> getNflplayergameCollection() {
        return nflplayergameCollection;
    }

    public void setNflplayergameCollection(Collection<Nflplayergame> nflplayergameCollection) {
        this.nflplayergameCollection = nflplayergameCollection;
    }

    @XmlTransient
    public Collection<Nflgame> getNflgameCollection() {
        return nflgameCollection;
    }

    public void setNflgameCollection(Collection<Nflgame> nflgameCollection) {
        this.nflgameCollection = nflgameCollection;
    }

    @XmlTransient
    public Collection<Nflgame> getNflgameCollection1() {
        return nflgameCollection1;
    }

    public void setNflgameCollection1(Collection<Nflgame> nflgameCollection1) {
        this.nflgameCollection1 = nflgameCollection1;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Nflteam)) {
            return false;
        }
        Nflteam other = (Nflteam) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.Nflteam[ id=" + id + " ]";
    }
    
}
